
<?php
if ($this->session->userdata('id') > 0) {

	if($account->num_rows() > 0){
		foreach($account->result() as $rows){
			if($rows->user_statu_id == 1){

?>


	<div>
			<div  style="border:1px solid #ccc; float:left; margin-bottom:3px; padding-left:35px;">
           		 <h4><a href="#"><?php echo $rows->user_fullName; ?></a></h4>
               <a href="<?php echo site_url('pages/user_profile/default'); ?>" title="Change photo">
               	<?php if($rows->user_img == ""){ ?>
                <img class="news_d_img_small" src="http://citizenmed.files.wordpress.com/2011/08/user-icon1.jpg" alt="" />
                <?php }else{ 
                
                    $image_user = array(
                        'src' => './assets/uploads/users/' . $rows->user_img,
                        'alt' => $rows->user_fullName,
                        'class' => 'post_images',
                        'width' => '80',
                        'height' => '70',
                        'title' => 'Change photo',
                        'rel' => 'lightbox',
                    );
                    echo img($image_user);
					
                    } ?>
                
               </a> 
               <?php 
                           if($this->uri->segment(3)=='error'){
                             echo  "<br /><p style='color:red;'>Images must be smaller than 200 X 200 !</p>";
                           }
			   if($this->uri->segment(3)=='default'){
				  echo '<div style="float:left;">';
				   echo form_open_multipart('pages/user_change_photo');
				   $upload = array(
                  		'name' => 'userfile',
						'placeholder' => 'Product upload....',
						'value' => set_value('userfile'),
						'type' => 'file',
						'size' => '20'
              		);
				   $getoldimg = array(
                  		'name' => 'getoldimg',
						'type' => 'hidden',
						'value' => $rows->user_img
              		);
				?>
                	
					<?php echo form_input($upload); ?>
                    <?php echo form_input($getoldimg); ?>
                    <div class="cleaner h10"></div>
                    <input type="submit" value="Save" id="submit" name="btn_upload" class="submit_btn float_r" />
                    
                    
                    <?php
                        echo form_close();
                    ?>
                    
                    </div>
        			<div class="cleaner h10"></div>
                	
                <?php	
				  }
			   ?>
               
                <ul style="display: inline;
    list-style:none;">
                	<li><a href="<?php echo site_url("pages/user_update_account/".$this->session->userdata('id')); ?>">Update account</a></li>
                    <li><a href="<?php echo site_url("pages/user_change_pass/".$this->session->userdata('id')); ?>">Change Password</a></li>
                    <li><a href="<?php echo site_url("pages/user_add_products"); ?>" >Add your products</a></li>
                    <li><a href="<?php echo site_url("pages/user_view_product"); ?>">View your products</a></li>
                    <li><a href="up_account?">Share to your friends</a></li>
                    <li><a href="up_account?">Find friends</a></li>
                </ul>
                <hr class="news_hr" />
                <!-- start view products -->
                
                   <div  style="float:left; margin-bottom:3px;">
                    <h4>Your all products</h4>
                    <?php 
                    if($this->uri->segment(3)=='dsucc')
                        echo '<h4 style="color:blue;">Deleted product successfull !!!</h4>';
                    if($this->uri->segment(3)=='addsucc')
                        echo '<h4 style="color:blue;">Added product successfull !!!</h4>';
                    ?>
                       <div style="float:left;">
                            
                                <?php 
                                if($pro_list->num_rows()>0){
                                    foreach($pro_list->result() as $rows){
                                ?>
                                
                                <div style="float:left; margin:5px;">
                               
                                <a href='<?php echo site_url().'assets/uploads/original/' . $rows->pro_img; ?>'>
								<?php
                                $image_properties = array(
                                    'src' => 'assets/uploads/thumbs/thumb_' . $rows->pro_img,
                                    'alt' => $rows->pro_name,
                                    'class' => 'post_images',
                                    'width' => '80',
                                    'height' => '70',
                                    'title' => $rows->pro_description,
                                    'rel' => 'lightbox',
                                );
                                echo img($image_properties);
                                ?>
                            </a>
                <br />
                
                               <!-- <a onclick="return confirm('Are you sure to delete ?');" class="prod_buy" href="<?php //echo site_url('pages/delete').'/'.$rows->pro_img; ?>">Delete</a>
                                ||
                                <a onclick="return confirm('Are you sure to update ?');" href="<?php //echo site_url('pages/sel_up_product').'/'.$rows->pro_id; ?>">Update</a>
                                <br /><br /><br />-->
                
                                </div>
                                <?php
                                    }
                                }
                                ?> 
                                
                           </div>
                           <h4>View pages :<?php echo $pages; ?></h4>
                        </div>
                <!-- end view products -->
            </div>
     </div>
  <?php
			}else{
				echo '<h2 style="color:blue;"> Sorry !! You have been blocked !</h2>';
				echo '<h3> Click Here to <a href="'.site_url("pages/logout").'">Contact with us </a> !</h3>';
			}
		}
	}
}else{
		redirect(site_url());
	}
  ?>
